#include<stdio.h>
#include<term.h>
#include<curses.h>
#include<stdlib.h>

/**************************************************
 * usage:
 * sudo apt-get install libncurses-dev
 * gcc 5.5_sizeterm.c -lncurses
 * ***********************************************/


int main(void)
{
	int nrows, ncolumns;
	
	setupterm(NULL, fileno(stdout), (int*)0);
	nrows = tigetnum("lines");
	ncolumns = tigetnum("cols");

	printf ("This terminal has %d columns and %d rows\n", ncolumns, nrows);

	return 0;
}
